<template>
  <el-tag :type="typeCode" size="mini">{{ row.learn_status_text }}</el-tag>
</template>

<script>
export default {
  props: {
    row: {
      type: Object,
      default: _ => {
        return {};
      }
    }
  },
  computed: {
    typeCode() {
      const row = this.row;
      let typeCode = 'info';

      if (row.learn_status_text == '已完成') {
        typeCode = 'success';
      } else if (row.learn_status_text == '学习中') {
        typeCode = null;
      }

      // if (row.learn_section_count === row.course_section_count) {
      //   typeCode = 'success'
      // } else if (row.learn_section_count > 0) {
      //   typeCode = null
      // } else if (row.learn_section_count === 0 && row.total_time_sec > 0) {
      //   typeCode = null
      // }

      return typeCode;
    }
  }
};
</script>
